package com.cimstech.model;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Created by dyzhu on 2015/12/24.
 */
@XmlRootElement(name = "nodes")
public class FileDirectory {
	private static final String FILE_ICON = "<span class=\"glyphicon glyphicon-file\"></span>";
	private static final String DIR_ICON = "<span class=\"glyphicon glyphicon-folder-close\"></span>";
	private boolean isLeaf = false;
	private String name;
	private String path;
	private String fullPath;
	private int size;
	private String lastModifiedTime;

	public FileDirectory(Boolean isDir, String title, String path, String fullPath, int size, String LastModifiedTime) {
		this.isLeaf = isDir;
		// if (isDir) {
		// this.name = DIR_ICON + title.replace("\\", "");
		// } else {
		// this.name = FILE_ICON + title.replace("\\", "");
		// }
		this.name = title;
		this.path = path;
		this.fullPath = fullPath;
		this.size = size;
		this.lastModifiedTime = LastModifiedTime;
	}

	public FileDirectory() {

	}

	@XmlElement(name = "isParent")
	public boolean isParent() {
		return isLeaf;
	}

	@XmlElement(name = "title")
	public String getName() {
		return this.name;
	}

	@XmlElement(name = "id")
	public String getId() {
		return this.path;
	}

	@XmlElement(name = "fullPath")
	public String getFullPath() {
		return this.fullPath;
	}

	@XmlElement(name = "lastModifiedTime")
	public String getLastModifiedTime() {
		return this.lastModifiedTime;
	}

	@XmlElement(name = "size")
	public int getSize() {
		return this.size;
	}
}
